Lightmap calculation

Lightmap is actually a texture that is applied to a model. This texture is calculated from direction, intensity and course of light rays in the scene.
The lightmap data are stored in *.ldt files.

Here, you can see an example of a lightmap (the helicopter shadow) applied to the terrain.



An example of a scene with lightmaps.



An example of a scene without lightmaps.



The path to the *.ldt files is as follows:

\[game directory]\levels\[map dir]\data\[sub-level dir]\ldt

Lightmaps can be also used to decrease the number of lights litghting an object. This is because all static lights that influence the lighting of an object are not applied to it anymore when it has a lightmap assigned. Thus only dynamic lighting is calculated during the game (for that object).


Settings dialog for lightmap calculation

panel: lms / compute selected
panel: lms / compute all

Load Obstacles loads the *.obs data file containing info regarding shadow casting objects,
if there is no such file, the calculation takes into account all objects in the scene
Global size multiplier map level of detail multiplier
the recommended value is between 0.5-1
Vertex distance tolerance which determines whether two adjacent triangles' border points share the same location
if the lightmap calculation on an edge between two triangles seems incorrect, it is recommended to increase this value, say to 0.05
Normal tolerance (of difference) between two normals of adjacent triangles used to determine whether the two triangles are in the same plane
if the lightmap calculation on two adjacent triangles seems incorrect, it is reccommended to increase this value, say to 0.1
Don't divide groups this switch determines whether adjacent triangles that are in the same plane should be taken into calculation as a single polygon or separately
Reverse casting this switch determines whether triangles should be treated as one-sided or two-sided in the calculation
Minimal side size minimal size of the rectangle side on the light map in pixels
if the lightmaps seem blurred on large triangles, it is recommended to increase this value


Sub-entity
LMs (Lightmaps) tab